/**
 * Schema.java
 *
 * Copyright (c) 2010 Prj.Manager All Rights Reserved.
 *
 * This source file may not be copied, modified or redistributed,
 * in whole or in part, in any form or for any reason, without the express
 * written consent of Prj.Manager .
 **/

package ro.prjmanager.model;


import javax.persistence.*;

/**
 * This class from the domain model is mapping the table schema_
 * @author Viorel Tacliciu
 * @version 1
 */

@Table(name="schema_")
@Entity
public class  Schema{

    //define attributes that maps all columns of the coresponding table
    //this attribute maps the primary key column ID
    private java.lang.Integer id;
    //this attribute maps an bidirectional association
    //it means that FK_SCHEMA from table db_schema is a foreign key to ID
    private java.util.List<DbSchema> fkSchemaDbSchema;
    //this attribute maps the column NAME
    private  java.lang.String  name;
    //this attribute maps the column USER
    private  java.lang.String  user;
    //this attribute maps the column PASSWORD
    private  java.lang.String  password;
    //end mapping columns

    //define getters and setters with coresponding ejb3 annotation, depending of the type
    //of the relation for the column

    /**
     * Mapping the primary key
     * @return - java.lang.Integer the primary key for this entity
     **/
    @Id
                 @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "ID")
    public  java.lang.Integer  getId(){
        return this.id;
    }

    /**
     * The setter for ID column
     * @param id -  an java.lang.Integer object
     **/
    public void setId( java.lang.Integer  id){
        this.id=id;
    }
    /**
     * This method maps an OneToMany relation between this table and
     * DbSchema table
     * @return - an list of DbSchema objects
     **/
    @OneToMany(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "FK_SCHEMA",referencedColumnName = "ID") 
    public java.util.List<DbSchema> getFkSchemaDbSchema(){
        return this.fkSchemaDbSchema;
    }
    
    /**
     * This method sets the field fkSchemaDbSchema of this entity
     * @param fkSchemaDbSchema - an list of DbSchema objects
     **/
    public void setFkSchemaDbSchema(java.util.List<DbSchema> fkSchemaDbSchema){
        this.fkSchemaDbSchema=fkSchemaDbSchema;
    }
    /**
     * This method gets the name attribute
     * @return - an  java.lang.String  object
     **/
    @Column(name = "NAME")
    public  java.lang.String  getName(){
        return this.name;
    }

    /**
     * The setter for NAME column
     * @param name -  an  java.lang.String  object
     **/
    public void setName( java.lang.String  name){
        this.name=name;
    }
    /**
     * This method gets the user attribute
     * @return - an  java.lang.String  object
     **/
    @Column(name = "USER")
    public  java.lang.String  getUser(){
        return this.user;
    }

    /**
     * The setter for USER column
     * @param user -  an  java.lang.String  object
     **/
    public void setUser( java.lang.String  user){
        this.user=user;
    }
    /**
     * This method gets the password attribute
     * @return - an  java.lang.String  object
     **/
    @Column(name = "PASSWORD")
    public  java.lang.String  getPassword(){
        return this.password;
    }

    /**
     * The setter for PASSWORD column
     * @param password -  an  java.lang.String  object
     **/
    public void setPassword( java.lang.String  password){
        this.password=password;
    }
}



